﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <link href="css/global.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery-1.8.3.min.js"></script>
    <script src="../js/jquery.easydropdown.min.js"></script>
    <script src="../bootstrap/iCheck-master/icheck.js"></script>
    <script src="../bootstrap/js/bootstrap.min.js"></script>
    <!--<script src="js/checkbox.js"></script>-->
    <script src="../js/PageIndex2.js"></script>
    <script src="http://static.tops001.com/kk.js"></script>
    <script src="../js/Common.js"></script>
    <script src="../js/jquery.iDialog.min.js" dialog-theme="default"></script>
    <script type="text/javascript" src="js/WdatePicker.js"></script>
    <title>报备首付贷</title>
    <style type="text/css">
        body {
            background: #eeeeee;
        }

        .detail {
            margin-bottom: 20px;
        }

        .dtitle {
            height: 46px;
            line-height: 46px;
            padding-left: 15px;
            background: #eeeeee;
            font-size: 16px;
            color: #666666;
            border-bottom: 1px solid #e4e4e4;
        }

        .dlist {
            padding-left: 15px;
            border-bottom: 1px solid #e4e4e4;
            background: #ffffff;
        }

            .dlist tr {
                border-bottom: 1px solid #e4e4e4;
            }

                .dlist tr:last-child {
                    border-bottom: 0 none;
                }

            .dlist th, .dlist td {
                height: 45px;
                line-height: 45px;
                font-size: 16px;
                color: #333333;
            }

            .dlist th {
                width: 100px;
                text-align: left;
            }

            .dlist tr td {
                padding-right: 15px;
                text-align: right;
            }

        .state_blue {
            color: #00aaff;
        }

        .state_green {
            color: #3ccb06;
        }

        .state_red {
            color: #ff4343;
        }

        .remain {
            line-height: 21px;
            padding: 12px 0;
        }
    </style>
</head>
<body>
    <div class="detail">
        <div class="dtitle">审核信息</div>
        <div class="dlist ApproveInfo">
            <table width="100%">
                <tr>
                    <th>审核结果</th>
                    <td>
                        {ApplyStatus}
                    </td>
                </tr>
                <!--审核不通过原因-->
                <tr class="reject">
                    <th>原因</th>
                    <td>
                        <div class="remain"> {Remark}</div>
                    </td>
                </tr>
                <!--剩余有效天数-->
                <tr class="availableDays">
                    <th>剩余有效天数</th>
                    <td>
                        <span class="AvailableDays state_red"></span>
                    </td>
                </tr>
            </table>
        </div>
        <div class="dtitle">贷款申请信息</div>
        <div class="dlist CustomerInfo">
            <table width="100%">
                <tr>
                    <th>贷款人</th>
                    <td>{CustomerName}</td>
                </tr>
                <tr>
                    <th>手机号</th>
                    <td>{MobilePhone}</td>
                </tr>
                <tr>
                    <th>身份证号</th>
                    <td>{IDCard}</span></td>
                </tr>
            </table>
        </div>
        <div class="dlist LoanInfo">
            <table width="100%">
                <tr>
                    <th>贷款金额</th>
                    <td>{LoanAmount}万元</td>
                </tr>
                <tr>
                    <th>购买楼盘</th>
                    <td><span class="BuildingName"></span></td>
                </tr>
                <tr>
                    <th>购买房号</th>
                    <td><span class="RoomInfo"></span></td>
                </tr>
                <tr>
                    <th>房屋面积</th>
                    <td><span class="Area"></span></td>
                </tr>
                <tr>
                    <th>房源总价</th>
                    <td>{Amount} 万元</td>
                </tr>
                <tr>
                    <th>申请时间</th>
                    <td>{ApplyTime}</td>
                </tr>
                <tr>
                    <th>报备人</th>
                    <td><span class="Broker"></span></td>
                </tr>
                <tr>
                    <th>报备人电话</th>
                    <td><span class="BrokerPhone"></span></td>
                </tr>
            </table>
        </div>
    </div>
    <script>
        $(document).ready(function () {
            GetCustomerLoanInfo();
        });

        function GetCustomerLoanInfo() {
            var id = kk.queryString('id');
            var requestParam = {
                loanInfoID: id
            };

            kk.api.jsonp("Customer/GetCustomerLoanInfo", requestParam, function (data) {
                //审核信息
                kk.fillData(".ApproveInfo", data.LoanInfoDTO, function (item, name) {
                    if (name == ["ApplyStatus"]) {
                        if (item[name] == 4) {
                            return '<span class="state_blue">审核中</span>';
                        } else if (item[name] == 8) {
                            return '<span class="state_green">审核通过</span>';
                        } else if (item[name] == 11) {
                            return '<span class="state_red">审核不通过</span>';
                        } else if (item[name] == 12) {
                            return '<span class="state_red">申请已失效</span>';
                        }
                    }
                });

                if (data.LoanInfoDTO.ApplyStatus != 11) {
                    $(".reject").hide();
                }

                if (data.LoanInfoDTO.ApplyStatus == 8) {
                    $(".availableDays").hide();
                }

                var applyTime = new Date(data.LoanInfoDTO.ApplyTime.replace(/-/g, "/"));
                var days = new Date().getTime() - applyTime.getTime();
                days = 30 - (parseInt(days / (1000 * 60 * 60 * 24)));
                if (days < 0) {
                    days = 0
                }
                $(".AvailableDays").text(days + "天");//剩余有效天数

                //贷款人信息
                kk.fillData(".CustomerInfo", data.CustomerDTO, function (item, name) {
                });

                //贷款信息
                kk.fillData(".LoanInfo", data.LoanInfoDTO, function (item, name) {
                });
                $(".BuildingName").text(data.HouseInfoExtendDTO.BuildingName);
                var roomInfo = data.HouseInfoExtendDTO.RoomInfo;
                $(".RoomInfo").text(roomInfo.substr(0, roomInfo.lastIndexOf(" ") + 1));
                $(".Area").text(roomInfo.substr(roomInfo.lastIndexOf(" ") + 1));
                $(".Broker").text(data.LoanFlowDTO.CheckUser);
                $(".BrokerPhone").text(data.LoanFlowDTO.Phone);
            });
        }
    </script>
</body>
</html>
